package pattern.observer;

import java.util.Vector;

public abstract class AbstractSubject implements Subject {
	private Vector<Observer> verctor = new Vector<Observer>();

	@Override
	public void add(Observer observer) {
		verctor.add(observer);
	}

	@Override
	public void del(Observer observer) {
		verctor.remove(observer);
	}

	@Override
	public void notifyObservers() {
		verctor.forEach(observer -> {
			observer.update();
		});
	}
}
